[chapterId].js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. "use strict";
  2. (() => {
  3. var exports = {};
  4. exports.id = 78185;
  5. exports.ids = [78185,64820];
  6. exports.modules = {
  7. /***/ 13176:
  8. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  9. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10. __webpack_require__.r(__webpack_exports__);
  11. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  12. /* harmony export */ "default": () => (/* binding */ pageWrapperTemplate),
  13. /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps),
  14. /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
  15. /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
  16. /* harmony export */ });
  17. /* harmony import */ var _sentry_server_config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96270);
  18. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58097);
  19. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__);
  20. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20997);
  21. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  22. /* harmony import */ var _components_chapters_Info_InfoPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(40206);
  23. /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95892);
  24. /* harmony import */ var _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45137);
  25. /* harmony import */ var _utils_validator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41051);
  26. /* harmony import */ var src_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92684);
  27. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_chapters_Info_InfoPage__WEBPACK_IMPORTED_MODULE_3__]);
  28. _components_chapters_Info_InfoPage__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  29. const ChapterInfo = (props)=>{
  30. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_chapters_Info_InfoPage__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
  31. ...props
  32. });
  33. };
  34. const getStaticProps$1 = async ({ params , locale })=>{
  35. let chapterIdOrSlug = String(params.chapterId);
  36. // we need to validate the chapterId first to save calling BE since we haven't set the valid paths inside getStaticPaths to avoid pre-rendering them at build time.
  37. if (!(0,_utils_validator__WEBPACK_IMPORTED_MODULE_5__/* .isValidChapterId */ .hP)(chapterIdOrSlug)) {
  38. const sluggedChapterId = await (0,src_api__WEBPACK_IMPORTED_MODULE_6__/* .getChapterIdBySlug */ .U0)(chapterIdOrSlug, locale);
  39. // if it's not a valid slug
  40. if (!sluggedChapterId) {
  41. return {
  42. notFound: true
  43. };
  44. }
  45. chapterIdOrSlug = sluggedChapterId;
  46. }
  47. const chaptersData = await (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_4__/* .getAllChaptersData */ .T4)(locale);
  48. try {
  49. const chapterInfoResponse = await (0,src_api__WEBPACK_IMPORTED_MODULE_6__/* .getChapterInfo */ .zg)(chapterIdOrSlug, locale);
  50. return {
  51. props: {
  52. chaptersData,
  53. chapterInfoResponse,
  54. chapterResponse: {
  55. chapter: (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_4__/* .getChapterData */ .dy)(chaptersData, chapterIdOrSlug)
  56. }
  57. },
  58. revalidate: _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_7__/* .ONE_MONTH_REVALIDATION_PERIOD_SECONDS */ .gi
  59. };
  60. } catch (error) {
  61. return {
  62. props: {
  63. hasError: true
  64. },
  65. revalidate: _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_7__/* .REVALIDATION_PERIOD_ON_ERROR_SECONDS */ .eW
  66. };
  67. }
  68. };
  69. const getStaticPaths = async ()=>({
  70. paths: [],
  71. fallback: "blocking"
  72. });
  73. var serverComponentModule = /*#__PURE__*/Object.freeze({
  74. __proto__: null,
  75. getStaticProps: getStaticProps$1,
  76. getStaticPaths: getStaticPaths,
  77. 'default': ChapterInfo
  78. });
  79. /*
  80. * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the
  81. * `pages/` directory.
  82. *
  83. * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,
  84. * this causes both TS and ESLint to complain, hence the pragma comments below.
  85. */
  86. const userPageModule = serverComponentModule ;
  87. const pageComponent = userPageModule ? userPageModule.default : undefined;
  88. const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;
  89. const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
  90. const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;
  91. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  92. const getInitialPropsWrappers = {
  93. '/_app': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapAppGetInitialPropsWithSentry,
  94. '/_document': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapDocumentGetInitialPropsWithSentry,
  95. '/_error': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapErrorGetInitialPropsWithSentry,
  96. };
  97. const getInitialPropsWrapper = getInitialPropsWrappers['/surah-info/[chapterId]'] || _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetInitialPropsWithSentry;
  98. if (pageComponent && typeof origGetInitialProps === 'function') {
  99. pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;
  100. }
  101. const getStaticProps =
  102. typeof origGetStaticProps === 'function'
  103. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetStaticPropsWithSentry(origGetStaticProps, '/surah-info/[chapterId]')
  104. : undefined;
  105. const getServerSideProps =
  106. typeof origGetServerSideProps === 'function'
  107. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/surah-info/[chapterId]')
  108. : undefined;
  109. const pageWrapperTemplate = pageComponent ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapPageComponentWithSentry(pageComponent ) : pageComponent;
  110. __webpack_async_result__();
  111. } catch(e) { __webpack_async_result__(e); } });
  112. /***/ }),
  113. /***/ 75184:
  114. /***/ ((module) => {
  115. module.exports = require("@reduxjs/toolkit");
  116. /***/ }),
  117. /***/ 58097:
  118. /***/ ((module) => {
  119. module.exports = require("@sentry/nextjs");
  120. /***/ }),
  121. /***/ 59003:
  122. /***/ ((module) => {
  123. module.exports = require("classnames");
  124. /***/ }),
  125. /***/ 59606:
  126. /***/ ((module) => {
  127. module.exports = require("humps");
  128. /***/ }),
  129. /***/ 12372:
  130. /***/ ((module) => {
  131. module.exports = require("lodash/findKey");
  132. /***/ }),
  133. /***/ 98492:
  134. /***/ ((module) => {
  135. module.exports = require("lodash/groupBy");
  136. /***/ }),
  137. /***/ 35526:
  138. /***/ ((module) => {
  139. module.exports = require("lodash/random");
  140. /***/ }),
  141. /***/ 64042:
  142. /***/ ((module) => {
  143. module.exports = require("lodash/range");
  144. /***/ }),
  145. /***/ 16641:
  146. /***/ ((module) => {
  147. module.exports = require("next-seo");
  148. /***/ }),
  149. /***/ 60866:
  150. /***/ ((module) => {
  151. module.exports = require("next-translate/useTranslation");
  152. /***/ }),
  153. /***/ 3280:
  154. /***/ ((module) => {
  155. module.exports = require("next/dist/shared/lib/app-router-context.js");
  156. /***/ }),
  157. /***/ 92796:
  158. /***/ ((module) => {
  159. module.exports = require("next/dist/shared/lib/head-manager-context.js");
  160. /***/ }),
  161. /***/ 94957:
  162. /***/ ((module) => {
  163. module.exports = require("next/dist/shared/lib/head.js");
  164. /***/ }),
  165. /***/ 3539:
  166. /***/ ((module) => {
  167. module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
  168. /***/ }),
  169. /***/ 34014:
  170. /***/ ((module) => {
  171. module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
  172. /***/ }),
  173. /***/ 50744:
  174. /***/ ((module) => {
  175. module.exports = require("next/dist/shared/lib/image-config-context.js");
  176. /***/ }),
  177. /***/ 35843:
  178. /***/ ((module) => {
  179. module.exports = require("next/dist/shared/lib/image-config.js");
  180. /***/ }),
  181. /***/ 78524:
  182. /***/ ((module) => {
  183. module.exports = require("next/dist/shared/lib/is-plain-object.js");
  184. /***/ }),
  185. /***/ 78020:
  186. /***/ ((module) => {
  187. module.exports = require("next/dist/shared/lib/mitt.js");
  188. /***/ }),
  189. /***/ 64406:
  190. /***/ ((module) => {
  191. module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
  192. /***/ }),
  193. /***/ 24964:
  194. /***/ ((module) => {
  195. module.exports = require("next/dist/shared/lib/router-context.js");
  196. /***/ }),
  197. /***/ 93431:
  198. /***/ ((module) => {
  199. module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
  200. /***/ }),
  201. /***/ 11751:
  202. /***/ ((module) => {
  203. module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
  204. /***/ }),
  205. /***/ 46220:
  206. /***/ ((module) => {
  207. module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
  208. /***/ }),
  209. /***/ 10299:
  210. /***/ ((module) => {
  211. module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
  212. /***/ }),
  213. /***/ 23938:
  214. /***/ ((module) => {
  215. module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
  216. /***/ }),
  217. /***/ 29565:
  218. /***/ ((module) => {
  219. module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
  220. /***/ }),
  221. /***/ 35789:
  222. /***/ ((module) => {
  223. module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
  224. /***/ }),
  225. /***/ 1897:
  226. /***/ ((module) => {
  227. module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
  228. /***/ }),
  229. /***/ 1428:
  230. /***/ ((module) => {
  231. module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
  232. /***/ }),
  233. /***/ 28854:
  234. /***/ ((module) => {
  235. module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
  236. /***/ }),
  237. /***/ 91292:
  238. /***/ ((module) => {
  239. module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
  240. /***/ }),
  241. /***/ 34567:
  242. /***/ ((module) => {
  243. module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
  244. /***/ }),
  245. /***/ 80979:
  246. /***/ ((module) => {
  247. module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
  248. /***/ }),
  249. /***/ 93297:
  250. /***/ ((module) => {
  251. module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
  252. /***/ }),
  253. /***/ 36052:
  254. /***/ ((module) => {
  255. module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
  256. /***/ }),
  257. /***/ 84226:
  258. /***/ ((module) => {
  259. module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
  260. /***/ }),
  261. /***/ 95052:
  262. /***/ ((module) => {
  263. module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
  264. /***/ }),
  265. /***/ 59232:
  266. /***/ ((module) => {
  267. module.exports = require("next/dist/shared/lib/utils.js");
  268. /***/ }),
  269. /***/ 71853:
  270. /***/ ((module) => {
  271. module.exports = require("next/router");
  272. /***/ }),
  273. /***/ 16689:
  274. /***/ ((module) => {
  275. module.exports = require("react");
  276. /***/ }),
  277. /***/ 20997:
  278. /***/ ((module) => {
  279. module.exports = require("react/jsx-runtime");
  280. /***/ }),
  281. /***/ 66704:
  282. /***/ ((module) => {
  283. module.exports = import("@radix-ui/react-tooltip");;
  284. /***/ }),
  285. /***/ 88813:
  286. /***/ ((module) => {
  287. module.exports = import("firebase/compat/analytics");;
  288. /***/ }),
  289. /***/ 33773:
  290. /***/ ((module) => {
  291. module.exports = import("firebase/compat/app");;
  292. /***/ }),
  293. /***/ 63477:
  294. /***/ ((module) => {
  295. module.exports = require("querystring");
  296. /***/ })
  297. };
  298. ;
  299. // load runtime
  300. var __webpack_require__ = require("../../webpack-runtime.js");
  301. __webpack_require__.C(exports);
  302. var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
  303. var __webpack_exports__ = __webpack_require__.X(0, [11497,79165,7477,96270,24709,57933,61239,25869,50497,36049,41051,42353,52271], () => (__webpack_exec__(13176)));
  304. module.exports = __webpack_exports__;
  305. })();
  306. //# sourceMappingURL=[chapterId].js.map